package Obj;

import Main.GameBegin;

import java.awt.*;

public class FlyObj extends GameObj{
    public FlyObj() {
    }

    public FlyObj(Image img, int width, int height, int x, int y, double speed, GameBegin gameBegin) {
        super(img, width, height, x, y, speed, gameBegin);
    }

    public FlyObj(Image img, int width, int height, int x, int y, double speed) {
        super(img, width, height, x, y, speed);
    }

    @Override
    public Rectangle getRec() {
        return super.getRec();
    }

    @Override
    public void paintSelf(Graphics g) {
        //更新Y坐标
        //实现子弹移动
        this.y += speed;
        if (img != null) {
            g.drawImage(img, this.x, this.y, width, height, null);
            System.out.println(this.x);
        }
    }
}
